package com.hkc.huakang.hkcpaperless;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class MyBroadcastRecevier  extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        //扫描结果的字符串数据
        final String scanResult_1 = intent.getStringExtra("SCAN_BARCODE1");
        final String scanResult_2 = intent.getStringExtra("SCAN_BARCODE2");
        //扫描结果的原始字节数据
        final byte[] scanResultByte_1 = intent.getByteArrayExtra("scan_result_one_bytes");
        final byte[] scanResultByte_2 = intent.getByteArrayExtra("scan_result_two_bytes");
        final int barcodeType = intent.getIntExtra("SCAN_BARCODE_TYPE", -1); // -1:unknown
        final String scanStatus = intent.getStringExtra("SCAN_STATE");
        Toast.makeText(context,"kalal",Toast.LENGTH_SHORT).show();

        if ("ok".equals(scanStatus)) {
            //成功
        } else {
            //失败如超时等
        }
    }
}
